<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="../../assets/css/layui.css">
    <link rel="stylesheet" href="../../assets/css/view.css"/>
    <title></title>
</head>
<body class="layui-view-body">
<div class="layui-content">
    <div class="layui-row">
        <div class="layui-card">
            <div class="layui-card-header">录入快件</div>
            <form class="layui-form layui-card-body" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">单号</label>
                    <div class="layui-input-block">
                        <input type="text" name="number" required lay-verify="required" placeholder="请输入快递单号"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">快递公司</label>
                    <div class="layui-input-block">
                        <select name="company" lay-verify="" lay-search>
                            <option value="安能快递">安能快递</option>
                            <option value="安能物流">安能物流</option>
                            <option value="澳大利亚邮政">澳大利亚邮政</option>
                            <option value="阿根廷邮政">阿根廷邮政</option>
                            <option value="爱沙尼亚邮政">爱沙尼亚邮政</option>
                            <option value="阿联酋邮政">阿联酋邮政</option>
                            <option value="奥地利邮政">奥地利邮政</option>
                            <option value="阿尔巴尼亚邮政">阿尔巴尼亚邮政</option>
                            <option value="Aramex">Aramex</option>
                            <option value="巴西邮政">巴西邮政</option>
                            <option value="比利时邮政">比利时邮政</option>
                            <option value="百世快运">百世快运</option>
                            <option value="波兰邮政">波兰邮政</option>
                            <option value="白俄罗斯邮政">白俄罗斯邮政</option>
                            <option value="中速快递">中速快递</option>
                        </select>

                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">收件人姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="username" required lay-verify="required" placeholder="请输入收货人姓名"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">手机号码</label>
                    <div class="layui-input-block">
                        <input type="text" name="userPhone" required lay-verify="required" placeholder="请输入手机号码"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-blue" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="../../assets/layui.all.js"></script>
<script src="../../../qrcode/jquery2.1.4.js"></script>
<script src="../../../layer/layer.js"></script>
<script>
    $(function () {
        var form = layui.form
            , layer = layui.layer;
        form.on('submit(formDemo)', function (data) {
            $.post(
                "add.do",
                {
                    number: data.field.number,
                    company: data.field.company,
                    username: data.field.username,
                    userPhone: data.field.userPhone,
                    type: 1
                },
                function (data) {
                    alert(data.msg);
                }, "JSON"
            );
        });
        //重置
        $(".layui-btn-primary").click(function () {
            $(".layui-form")[0].reset();
        });
    });
</script>
</body>
</html>